#include<bits/stdc++.h>
using namespace std;
int n,a[5010],vis[5010],sum[5010];
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++) scanf("%d",&a[i]);
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++) vis[j]=0;
int idx=0;
for(int j=i;j<=n;j++){
vis[a[j]]++;
if(vis[a[j]]>vis[idx]) idx=a[j];
else if(vis[a[j]]==vis[idx]){
if(idx>=a[j]) idx=a[j];
}
sum[idx]++;
}
}
for(int i=1;i<=n;i++) printf("%d ",sum[i]);
return 0;
}
892B - Wrath | 999A - Mishka and Contest |
727C - Guess the Array | 1625C - Road Optimization |
1715D - 2+ doors | 267A - Subtractions |
1582A - Luntik and Concerts | 560A - Currency System in Geraldion |
946A - Partition | 1068B - LCM |
1692E - Binary Deque | 679A - Bear and Prime 100 |
488A - Giga Tower | 14A - Letter |
1150A - Stock Arbitraging | 1552A - Subsequence Permutation |
1131F - Asya And Kittens | 1475F - Unusual Matrix |
133B - Unary | 1547A - Shortest Path with Obstacle |
624A - Save Luke | 1238A - Prime Subtraction |
1107C - Brutality | 1391B - Fix You |
988B - Substrings Sort | 312A - Whose sentence is it |
513A - Game | 1711E - XOR Triangle |
688A - Opponents | 20C - Dijkstra |